/**
 * @description: 订单参数校验
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';
import { requiredNumber, requiredString } from "./common";

export class CommonOrder {
  @Rule(requiredString)
  orderName: string;
  @Rule(RuleType.any())
  orderDetails: any;
  @Rule(RuleType.any())
  orderId: any;
  @Rule(RuleType.any())
  remarks: any;
  @Rule(RuleType.any())
  brandName: any;
}

export class CostOrder {
  @Rule(requiredString)
  cost_name: string;
  @Rule(requiredNumber)
  cost_amount: number;
  @Rule(RuleType.any())
  cost_remark: any;
}

// 项目列表分页查询参数校验
export class CreatedOrderDTO extends CommonOrder {
  @Rule(requiredNumber)
  createdProject: number;
}

// 项目列表分页查询参数校验
export class UpdateOrderInfoDTO extends CommonOrder {
  @Rule(requiredNumber)
  id: number;
}

//  订单新增其他成本
export class CreateOrderCostInfo extends CostOrder{
  @Rule(requiredNumber)
  order_id: number;
}

//  订单更新其他成本
export class UpdateOrderCostInfo extends CostOrder{
  @Rule(requiredNumber)
  id: number;
}